<template>
  <div>
    <Loading v-if="isLoading" />
    <div v-else>
        homeData: {{ homeData }}
    </div>
  </div>
</template>

<script lang="ts">
import Loading from '@/components/Loading.vue';
import { Component, Vue } from 'vue-property-decorator';
import { getHomeData } from '../api/index';

@Component({
    components: {
        Loading
    }
})
export default class Home extends Vue {
    public isLoading = true;
    public homeData = '';
    async created() {
        try {
            const homeData = await getHomeData();
            this.homeData = homeData;
            this.isLoading = false;
        } catch(e) {
            console.log(e);
        }
    }
    mounted() {
        console.log(this);
    }
}
</script>

<style scoped>
</style>
